﻿package plugin.activity
{
    import cmd.*;
    import com.core.*;
    import com.greensock.*;
    import com.sh.game.display.*;
    import com.sh.game.global.*;
    import com.sh.game.util.*;
    import consts.*;
    import flash.display.*;
    import flash.events.*;
    import flash.external.*;
    import flash.geom.*;
    import flash.text.*;
    import flash.utils.*;
    import manager.*;
    import morn.core.components.*;
    import morn.core.handlers.*;
    import plugin.activity.newComponent.*;
    import uiresource.activity.*;
    import view.*;
    import view.light.*;
    import view.message.*;
    import view.mornExtends.*;
    import view.uilt.*;
    import vo.*;

    public class NewActivityUICtrl extends activityUI
    {
        private var _close:Function;
        private var type:int = 0;
        private var panelArr:Array;
        private var init:Boolean = false;
        private var listupdata:Number = 0;
        private var _taskid:uint = 0;
        private var intime:int;
        private var curid:int;
        private var servertime:int;
        private var cfgonline:Object;
        private var sp1:Sprite;
        private var sp2:Sprite;
        private var sp3:Sprite;
        private var sp4:Sprite;
        private var itemw:int = 58;
        private const IMGWH:Number = 58;
        private const BOX_Y:Number = 122;
        private var guideArr:Array;
        private var baoxian:Class;
        private var boxMC1:XMLMovieClip;
        private var boxMC2:XMLMovieClip;
        private var boxMC3:XMLMovieClip;
        private var boxMC4:XMLMovieClip;
        private var mcArr:Array;
        private var currView:int;
        private var isFirstQD:Boolean = true;
        private var riliCon:Sprite;
        private var itemArr:Array;
        private var today:Number;
        private var count:int = 0;
        private var qdReward:Object;
        private var cfgitem:Object;
        private var qdType:int = 1;
        private var isFirst:Boolean = true;
        private var time:Number;
        private var maxMonth:Number;
        private var _isInit:Boolean = false;
        private var tan_mon_img:UrlImage;
        private var tan_count_img:UrlImage;
        private var timelinetab:TweenMax;
        private var timelinelingtn:TweenMax;
        private var flag:Boolean = true;
        private var _timeID:uint = 0;
        private var isflag:Boolean = true;
        private var timela:uint = 0;
        private var lucount:int;
        private var textInput:TextField;
        private var lxjyText:TextField;
        private var _type:int = 0;
        private var storeitems:Array = null;
        private var _confitem:Object;
        private var _storeids:Array;
        private var leavehour:int;
        private var timetxt:int = -1;
        private var isFirstClick:Boolean = true;
        private static var _isShow:Boolean;

        public function NewActivityUICtrl(param1:Function)
        {
            this.panelArr = [];
            this.guideArr = [0, 0, 0];
            this.baoxian = NewActivityUICtrl_baoxian;
            this.itemArr = [];
            this.qdReward = ConfigDictionary.data.activity_qd;
            this.cfgitem = ConfigDictionary.data.item;
            this._storeids = [168, 169, 170];
            this._close = param1;
            return;
        }// end function

        override protected function initializeView() : void
        {
            super.initializeView();
            this.curid = UserData.getOnlineData("curid");
            if (this.curid < 5)
            {
                App.mloader3.loadSWF(Config.getUrl("assets/images/mainui/baoxian.swf"), 1, new Handler(this.completeFunc1));
            }
            var _loc_1:* = Control.create(ActivityControl, this);
            ModelProxy.addObserver("activity", _loc_1);
            ModelProxy.addObserver("online", _loc_1);
            this.cfgonline = ConfigDictionary.data.online;
            this.panelArr = [qiandaoPanel, zaixianPanel, liquanPanel, lixianPanel, phonePanel];
            btn_left2.name = "2";
            btn_left2.selected = false;
            btn_left2.addEventListener(MouseEvent.CLICK, this.onLeftHandler);
            btn_left3.name = "3";
            btn_left3.selected = false;
            btn_left3.addEventListener(MouseEvent.CLICK, this.onLeftHandler);
            btn_left6.name = "6";
            btn_left6.selected = false;
            btn_left6.addEventListener(MouseEvent.CLICK, this.onLeftHandler);
            btn_left5.name = "5";
            btn_left5.selected = false;
            btn_left5.addEventListener(MouseEvent.CLICK, this.onLeftHandler);
            btn_left4.name = "1";
            btn_left4.selected = false;
            btn_left4.addEventListener(MouseEvent.CLICK, this.onLeftHandler);
            qiandaoPanel.visible = false;
            zaixianPanel.visible = false;
            liquanPanel.visible = false;
            lixianPanel.visible = false;
            phonePanel.visible = false;
            this.init = true;
            label_twoyb.x = 283;
            tips_txt.text = "本周累积礼券下周二领取";
            closeBtn.addEventListener(MouseEvent.CLICK, this.onClose);
            var _loc_2:int = 1;
            while (_loc_2 < 5)
            {
                
                this["liwu_img" + _loc_2].addEventListener(MouseEvent.ROLL_OVER, this.onOverimg);
                this["liwu_img" + _loc_2].addEventListener(MouseEvent.ROLL_OUT, this.out);
                _loc_2++;
            }
            return;
        }// end function

        private function completeFunc1(param1:Object) : void
        {
            var _loc_3:XML = null;
            this.mcArr = [];
            var _loc_2:int = 1;
            while (_loc_2 < 5)
            {
                
                _loc_3 = new XML(new this.baoxian());
                this["boxMC" + _loc_2] = new XMLMovieClip("png.baoxian", _loc_3);
                this["boxMC" + _loc_2].mouseChildren = false;
                this["boxMC" + _loc_2].mouseEnabled = false;
                this["boxMC" + _loc_2].x = -86;
                this["boxMC" + _loc_2].y = -105;
                this["boxMC" + _loc_2].visible = false;
                this["boxMC" + _loc_2].play();
                this.mcArr.push(this["boxMC" + _loc_2]);
                this["box" + _loc_2].addChildAt(this["boxMC" + _loc_2], 3);
                _loc_2++;
            }
            return;
        }// end function

        private function out(event:Event) : void
        {
            ModelProxy.change("tips", "state", "close");
            return;
        }// end function

        private function onOverimg(event:Event) : void
        {
            var _loc_2:* = event.currentTarget as UrlImage;
            var _loc_3:String = "";
            switch(_loc_2)
            {
                case liwu_img1:
                {
                    _loc_3 = this.reItemName(this.getBoxArr(this.cfgonline[1].boxid));
                    break;
                }
                case liwu_img2:
                {
                    _loc_3 = this.reItemName(this.getBoxArr(this.cfgonline[2].boxid));
                    break;
                }
                case liwu_img3:
                {
                    _loc_3 = this.reItemName(this.getBoxArr(this.cfgonline[3].boxid));
                    break;
                }
                case liwu_img4:
                {
                    _loc_3 = this.reItemName(this.getBoxArr(this.cfgonline[4].boxid));
                    break;
                }
                default:
                {
                    break;
                }
            }
            ModelProxy.change("tips", "normal", _loc_3);
            return;
        }// end function

        private function reItemName(param1:Array) : String
        {
            var _loc_3:Object = null;
            var _loc_2:String = "";
            for each (_loc_3 in param1)
            {
                
                if (_loc_3.name)
                {
                    _loc_2 = _loc_2 + (_loc_3.name + "*" + _loc_3.count + "\n");
                }
            }
            return _loc_2;
        }// end function

        public function updateLevel() : void
        {
            var _loc_3:Box = null;
            var _loc_1:Boolean = false;
            var _loc_2:int = 0;
            while (_loc_2 < 5)
            {
                
                _loc_3 = this["lb" + (_loc_2 + 1)];
                if (_loc_3)
                {
                    if (PluginManager.instance.checkOpenLevel("activity", (_loc_2 + 1)))
                    {
                        if (_loc_3.parent)
                        {
                            _loc_1 = true;
                            _loc_3.parent.removeChild(_loc_3);
                        }
                    }
                    else if (!_loc_3.parent)
                    {
                        _loc_1 = true;
                        this.tabContainer.addChild(_loc_3);
                    }
                }
                if (_loc_1)
                {
                    if (_loc_2 == 4)
                    {
                        _loc_3.y = tabContainer.numChildren * _loc_3.height;
                    }
                    else
                    {
                        _loc_3.y = _loc_2 * _loc_3.height;
                    }
                }
                _loc_2++;
            }
            return;
        }// end function

        private function onLeftHandler(event:MouseEvent) : void
        {
            ModelProxy.change("guide", "hide", GuideType.GUIDE_QD);
            ModelProxy.change("guide", "hide", GuideType.GUIDE_ZXJL);
            var _loc_2:* = event.currentTarget as Button;
            _loc_2.selected = true;
            this.type = int(_loc_2.name);
            this.showView(this.type);
            return;
        }// end function

        public function showView(param1:int) : void
        {
            PluginManager.instance.sendToServer("online", CMDOnline.getonlineInfo, null);
            PluginManager.instance.sendToServer("activity", CMDActivity.GetZaiXian, null);
            PluginManager.instance.sendToServer("activity", CMDActivity.GetLiXian, null);
            if (this.currView == param1)
            {
                this.doActiveGuide();
                return;
            }
            this.currView = param1;
            this.type = param1;
            if (!this.init)
            {
                return;
            }
            this.updateLevel();
            if (param1 == 1 || param1 == 2 || param1 == 3 || param1 == 6 || param1 == 5)
            {
                if (param1 == 1)
                {
                    this["btn_left4"].selected = true;
                    this["btn_left2"].selected = false;
                    this["btn_left3"].selected = false;
                    this["btn_left6"].selected = false;
                    this["btn_left5"].selected = false;
                }
                else if (param1 == 2)
                {
                    this["btn_left4"].selected = false;
                    this["btn_left2"].selected = true;
                    this["btn_left3"].selected = false;
                    this["btn_left6"].selected = false;
                    this["btn_left5"].selected = false;
                }
                else if (param1 == 3)
                {
                    this["btn_left4"].selected = false;
                    this["btn_left2"].selected = false;
                    this["btn_left3"].selected = true;
                    this["btn_left6"].selected = false;
                    this["btn_left5"].selected = false;
                }
                else if (param1 == 5)
                {
                    this["btn_left5"].selected = true;
                    this["btn_left2"].selected = false;
                    this["btn_left3"].selected = false;
                    this["btn_left6"].selected = false;
                    this["btn_left4"].selected = false;
                }
                else if (param1 == 6)
                {
                    this["btn_left4"].selected = false;
                    this["btn_left2"].selected = false;
                    this["btn_left3"].selected = false;
                    this["btn_left6"].selected = true;
                    this["btn_left5"].selected = false;
                }
                this.doActiveGuide();
                this.show();
            }
            return;
        }// end function

        private function show() : void
        {
            var _loc_1:int = 0;
            while (_loc_1 < this.panelArr.length)
            {
                
                this.panelArr[_loc_1].visible = false;
                _loc_1++;
            }
            switch(this.type)
            {
                case 1:
                {
                    qiandaoPanel.visible = true;
                    this.showQianDao();
                    break;
                }
                case 2:
                {
                    zaixianPanel.visible = true;
                    this.OnlineShow();
                    this.showZaiXian();
                    PluginManager.instance.sendToServer("activity", CMDActivity.GetZaiXian, null);
                    break;
                }
                case 3:
                {
                    liquanPanel.visible = true;
                    this.showLiQuan();
                    this.panelArr.push(liquanPanel);
                    break;
                }
                case 5:
                {
                    phonePanel.visible = true;
                    this.showPhonePanel();
                    break;
                }
                case 6:
                {
                    lixianPanel.visible = true;
                    this.isFirstClick = false;
                    this.showLiXian();
                    PluginManager.instance.sendToServer("activity", CMDActivity.GetLiXian, null);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        private function onClose(event:MouseEvent) : void
        {
            ModelProxy.change("plugin", "close", "activity");
            return;
        }// end function

        private function showQianDao() : void
        {
            if (this.riliCon && this.riliCon.parent)
            {
                this.riliCon.parent.removeChild(this.riliCon);
                this.riliCon = null;
            }
            this.riliCon = new Sprite();
            this.riliCon.x = 4;
            this.riliCon.y = 90;
            qiandaoPanel.addChild(this.riliCon);
            this.tan_mon_img = new UrlImage();
            qiandaoPanel.addChild(this.tan_mon_img);
            this.tan_mon_img.x = yuenum.x - 18;
            this.tan_mon_img.y = yuenum.y;
            this.tan_mon_img.visible = false;
            this.tan_count_img = new UrlImage();
            qiandaoPanel.addChild(this.tan_count_img);
            this.tan_count_img.x = num.x - 18;
            this.tan_count_img.y = num.y;
            this.tan_count_img.visible = false;
            qiandaoBtn.addEventListener(MouseEvent.CLICK, this.onQianDao);
            lingtn.addEventListener(MouseEvent.CLICK, this.onLingQu);
            btn_jhvip.visible = false;
            btn_jhvip.addEventListener(MouseEvent.CLICK, this.onJiHuo);
            tab.addEventListener(MouseEvent.CLICK, this.onTab);
            this._isInit = true;
            this.initRiLi();
            return;
        }// end function

        public function initRiLi() : void
        {
            var _loc_10:NewRiLiItem = null;
            var _loc_12:NewRiLiItem = null;
            var _loc_13:Date = null;
            if (!this._isInit)
            {
                return;
            }
            var _loc_1:* = UserData.getOnlineData("qd");
            var _loc_2:* = _loc_1.split("#");
            var _loc_3:* = int((ModelProxy.getValue("data", "servertime") + Number(getTimer())) / 1000);
            var _loc_4:* = new Date(_loc_3 * 1000);
            var _loc_5:* = new Date(_loc_3 * 1000).month;
            var _loc_6:* = _loc_4.day;
            this.today = _loc_4.date;
            if ((_loc_5 + 1) < 10)
            {
                yuenum.url = "cs2_activity/0" + (_loc_5 + 1) + ".png";
                this.tan_mon_img.visible = false;
            }
            else
            {
                this.tan_mon_img.url = "cs2_activity/01.png";
                this.tan_mon_img.visible = true;
                yuenum.url = "cs2_activity/0" + ((_loc_5 + 1) - 10) + ".png";
            }
            this.time = _loc_4.getTime() - (this.today - 1) * 24 * 3600000;
            var _loc_7:* = new Date(this.time - 24 * 3600000);
            var _loc_8:* = new Date(this.time - 24 * 3600000).day;
            this.maxMonth = _loc_5;
            this.itemArr = [];
            while (this.riliCon.numChildren > 0)
            {
                
                this.riliCon.removeChildAt(0);
            }
            while (_loc_5 == this.maxMonth)
            {
                
                _loc_12 = new NewRiLiItem();
                _loc_13 = new Date(this.time);
                _loc_12.data = _loc_13;
                _loc_12.x = _loc_8 % 7 * 540 / 7;
                _loc_12.y = Math.floor(_loc_8 / 7) * 187 / 6;
                this.riliCon.addChild(_loc_12);
                this.itemArr.push(_loc_12);
                _loc_8++;
                this.time = this.time + 24 * 3600000;
                this.maxMonth = this.getMonth(this.time);
            }
            var _loc_9:int = 0;
            this.count = 0;
            for each (_loc_10 in this.itemArr)
            {
                
                if (_loc_10.data.date < this.today)
                {
                    if (int(_loc_2[_loc_9]) == 0)
                    {
                        _loc_10.setBuQian();
                    }
                    else
                    {
                        _loc_10.setYiQian();
                        var _loc_16:String = this;
                        var _loc_17:* = this.count + 1;
                        _loc_16.count = _loc_17;
                    }
                }
                else if (_loc_10.data.date == this.today)
                {
                    if (int(_loc_2[_loc_9]) == 1)
                    {
                        _loc_10.setYiQian();
                        qiandaoBtn.mouseEnabled = false;
                        qiandaoBtn.visible = false;
                        ljqd_img.visible = false;
                        var _loc_16:String = this;
                        var _loc_17:* = this.count + 1;
                        _loc_16.count = _loc_17;
                        LightFactory.clearlight(qiandaoBtn);
                        this.guideArr[0] = 0;
                    }
                    else
                    {
                        qiandaoBtn.mouseChildren = true;
                        qiandaoBtn.visible = true;
                        this.guideArr[0] = 1;
                        LightFactory.showlight(qiandaoBtn);
                        ljqd_img.visible = true;
                    }
                    _loc_10.setToday();
                }
                _loc_9++;
            }
            if (this.count < 10)
            {
                num.url = "cs2_activity/0" + this.count + ".png";
                this.tan_count_img.visible = false;
            }
            else
            {
                this.tan_count_img.visible = true;
                this.tan_count_img.url = "cs2_activity/0" + this.count.toString().charAt(0) + ".png";
                num.url = "cs2_activity/0" + this.count.toString().charAt(1) + ".png";
            }
            var _loc_11:* = ModelProxy.getValue("vip", "getvip");
            if (ModelProxy.getValue("vip", "getvip").leftSignCount >= 0)
            {
                label_qiandao.text = "本月补签剩余次数：<font color=\'#53b436\'>" + _loc_11.leftSignCount + "</font>";
            }
            else
            {
                label_qiandao.text = "无限次补签";
            }
            this.qdType = this.getType();
            tab.selectedIndex = this.qdType - 1;
            if (qiandaoBtn.visible)
            {
                ModelProxy.change("guideitem", "guideid" + GuideType.GUIDE_QD, qiandaoBtn);
                GuideView.getInstance().doGuide(GuideType.GUIDE_QD);
            }
            this.Qdshow();
            return;
        }// end function

        private function getType() : int
        {
            var _loc_1:int = 1;
            _loc_1 = 1;
            while (_loc_1 < 6)
            {
                
                this.qdType = _loc_1;
                this.qdType = this.checkget();
                if (this.qdType > 0)
                {
                    return _loc_1;
                }
                _loc_1++;
            }
            if (this.qdType == 0)
            {
                this.qdType = 1;
            }
            return this.qdType;
        }// end function

        private function getMonth(param1:Number) : Number
        {
            var _loc_2:* = new Date(param1);
            var _loc_3:* = _loc_2.getMonth();
            return _loc_3;
        }// end function

        public function Qdshow() : void
        {
            var _loc_6:String = null;
            var _loc_7:String = null;
            var _loc_8:Array = null;
            var _loc_9:Array = null;
            var _loc_10:Array = null;
            var _loc_11:String = null;
            var _loc_12:String = null;
            var _loc_13:Array = null;
            var _loc_14:Object = null;
            var _loc_15:Object = null;
            var _loc_1:* = ModelProxy.getValue("vip", "getvip.vipLevel");
            if (_loc_1 > 0)
            {
                btn_jhvip.visible = false;
            }
            else if (Config.hexie == false)
            {
                btn_jhvip.visible = true;
            }
            else
            {
                btn_jhvip.visible = false;
            }
            var _loc_2:* = this.qdReward[this.qdType].param;
            var _loc_3:* = _loc_2.split(";");
            var _loc_4:Array = [];
            var _loc_5:Array = [];
            for each (_loc_6 in _loc_3)
            {
                
                _loc_4 = _loc_6.split("#");
                _loc_14 = ItemObject.create(this.cfgitem[_loc_4[0]]);
                _loc_14.count = _loc_4[1];
                if (_loc_14)
                {
                    _loc_5.push(_loc_14);
                }
            }
            _loc_7 = this.qdReward[this.qdType].vipparam;
            _loc_8 = _loc_7.split(";");
            _loc_9 = [];
            _loc_10 = [];
            for each (_loc_11 in _loc_8)
            {
                
                _loc_9 = _loc_11.split("#");
                _loc_15 = ItemObject.create(this.cfgitem[_loc_9[0]]);
                _loc_15.count = _loc_9[1];
                if (_loc_15)
                {
                    _loc_10.push(_loc_15);
                }
            }
            listr.array = _loc_5;
            listr1.array = _loc_10;
            listr.renderHandler = new Handler(this.listrHandler);
            listr1.renderHandler = new Handler(this.listrHandler1);
            _loc_12 = UserData.getOnlineData("qdlq");
            _loc_13 = _loc_12.split("#");
            if (int(_loc_13[(this.qdType - 1)]) == 1)
            {
                this.cleartimelinetab();
                lingtn.disabled = false;
                lingtn.label = "已领取";
                lingtn.disabled = true;
            }
            else
            {
                lingtn.label = "领取奖励";
                lingtn.disabled = false;
                lingtn.mouseEnabled = true;
                if (this.qdType == 1)
                {
                    if (this.count < 2)
                    {
                        lingtn.disabled = true;
                    }
                    else
                    {
                        this.cleartimelinetab();
                        this.timelinetab = TweenMax.to(tab.getChildAt(0), 1, {glowFilter:{color:16763904, alpha:1, blurX:15, blurY:15}, repeat:10000, yoyo:true});
                        this.timelinelingtn = TweenMax.to(lingtn, 1, {glowFilter:{color:16763904, alpha:1, blurX:15, blurY:15}, repeat:10000, yoyo:true});
                    }
                }
                else if (this.qdType == 2)
                {
                    if (this.count < 5)
                    {
                        lingtn.disabled = true;
                    }
                    else
                    {
                        this.cleartimelinetab();
                        this.timelinelingtn = TweenMax.to(lingtn, 1, {glowFilter:{color:16763904, alpha:1, blurX:15, blurY:15}, repeat:10000, yoyo:true});
                        this.timelinetab = TweenMax.to(tab.getChildAt(1), 1, {glowFilter:{color:16763904, alpha:1, blurX:15, blurY:15}, repeat:10000, yoyo:true});
                    }
                }
                else if (this.qdType == 3)
                {
                    if (this.count < 10)
                    {
                        lingtn.disabled = true;
                    }
                    else
                    {
                        this.cleartimelinetab();
                        this.timelinelingtn = TweenMax.to(lingtn, 1, {glowFilter:{color:16763904, alpha:1, blurX:15, blurY:15}, repeat:10000, yoyo:true});
                        this.timelinetab = TweenMax.to(tab.getChildAt(2), 1, {glowFilter:{color:16763904, alpha:1, blurX:15, blurY:15}, repeat:10000, yoyo:true});
                    }
                }
                else if (this.qdType == 4)
                {
                    if (this.count < 17)
                    {
                        lingtn.disabled = true;
                    }
                    else
                    {
                        this.cleartimelinetab();
                        this.timelinelingtn = TweenMax.to(lingtn, 1, {glowFilter:{color:16763904, alpha:1, blurX:15, blurY:15}, repeat:10000, yoyo:true});
                        this.timelinetab = TweenMax.to(tab.getChildAt(3), 1, {glowFilter:{color:16763904, alpha:1, blurX:15, blurY:15}, repeat:10000, yoyo:true});
                    }
                }
                else if (this.qdType == 5)
                {
                    if (this.count < 26)
                    {
                        lingtn.disabled = true;
                    }
                    else
                    {
                        this.cleartimelinetab();
                        this.timelinelingtn = TweenMax.to(lingtn, 1, {glowFilter:{color:16763904, alpha:1, blurX:15, blurY:15}, repeat:10000, yoyo:true});
                        this.timelinetab = TweenMax.to(tab.getChildAt(4), 1, {glowFilter:{color:16763904, alpha:1, blurX:15, blurY:15}, repeat:10000, yoyo:true});
                    }
                }
            }
            return;
        }// end function

        private function cleartimelinetab() : void
        {
            var _loc_1:int = 0;
            if (this.timelinetab)
            {
                this.timelinetab.kill();
                this.timelinetab = null;
                _loc_1 = 0;
                while (_loc_1 < tab.numChildren)
                {
                    
                    if (tab.getChildAt(_loc_1).filters)
                    {
                        tab.getChildAt(_loc_1).filters = [];
                    }
                    _loc_1++;
                }
                if (this.timelinelingtn)
                {
                    this.timelinelingtn.kill();
                    this.timelinelingtn = null;
                    lingtn.filters = [];
                }
            }
            return;
        }// end function

        private function listrHandler1(param1:Component, param2:int) : void
        {
            var _loc_3:FlashItem = null;
            if (param2 < listr1.array.length)
            {
                _loc_3 = param1.getChildByName("fi") as FlashItem;
                _loc_3.effshow = true;
                _loc_3.data = listr1.array[param2];
            }
            return;
        }// end function

        private function listrHandler(param1:Component, param2:int) : void
        {
            var _loc_3:FlashItem = null;
            if (param2 < listr.array.length)
            {
                _loc_3 = param1.getChildByName("fi") as FlashItem;
                _loc_3.effshow = true;
                _loc_3.data = listr.array[param2];
            }
            return;
        }// end function

        public function checkget() : int
        {
            var _loc_1:* = UserData.getOnlineData("qdlq");
            var _loc_2:* = _loc_1.split("#");
            if (int(_loc_2[(this.qdType - 1)]) == 1)
            {
                lingtn.label = "已领取";
                lingtn.disabled = true;
                return 0;
            }
            lingtn.label = "领取奖励";
            lingtn.disabled = false;
            lingtn.mouseEnabled = true;
            if (this.qdType == 1)
            {
                if (this.count < 2)
                {
                    lingtn.disabled = true;
                }
            }
            else if (this.qdType == 2)
            {
                if (this.count < 5)
                {
                    lingtn.disabled = true;
                }
            }
            else if (this.qdType == 3)
            {
                if (this.count < 10)
                {
                    lingtn.disabled = true;
                }
            }
            else if (this.qdType == 4)
            {
                if (this.count < 17)
                {
                    lingtn.disabled = true;
                }
            }
            else if (this.qdType == 5)
            {
                if (this.count < 26)
                {
                    lingtn.disabled = true;
                }
            }
            return this.qdType;
        }// end function

        private function onQianDao(event:MouseEvent) : void
        {
            if (GuideView.getInstance().checkIsDo(GuideType.GUIDE_CLOSEQD))
            {
                GuideView.getInstance().doGuide(GuideType.GUIDE_CLOSEQD);
            }
            PluginManager.instance.sendToServer("activity", CMDActivity.QianDao, {today:this.today, type:0});
            this.guideArr[0] = 0;
            this.doActiveGuide();
            return;
        }// end function

        private function onLingQu(event:MouseEvent) : void
        {
            var _loc_2:int = 0;
            var _loc_3:int = 0;
            var _loc_4:Point = null;
            var _loc_5:Array = null;
            var _loc_6:int = 0;
            var _loc_7:int = 0;
            if (this.flag)
            {
                this.flag = false;
                this._timeID = setTimeout(this.setFlag, 1000);
                _loc_5 = [];
                _loc_6 = 0;
                while (_loc_6 < listr.array.length)
                {
                    
                    _loc_2 = 247 + _loc_6 * 58;
                    _loc_3 = 350;
                    _loc_4 = localToGlobal(new Point(_loc_2, _loc_3));
                    _loc_5[_loc_6] = {x:_loc_4.x, y:_loc_4.y};
                    _loc_6++;
                }
                if (ItemUilt.checkVip())
                {
                    _loc_7 = listr.array.length;
                    while (_loc_7 < listr1.array.length + listr.array.length)
                    {
                        
                        _loc_2 = 363 + (_loc_7 - listr.array.length) * 58;
                        _loc_3 = 446;
                        _loc_4 = localToGlobal(new Point(_loc_2, _loc_3));
                        _loc_5[_loc_7] = {x:_loc_4.x, y:_loc_4.y};
                        _loc_7++;
                    }
                }
                ModelProxy.change("data", "qditempoint", _loc_5);
                PluginManager.instance.sendToServer("activity", CMDActivity.LingQu, this.qdType);
            }
            return;
        }// end function

        private function onJiHuo(event:MouseEvent) : void
        {
            PluginManager.instance.changePlugin("vip", new Point(100, 100));
            return;
        }// end function

        private function onTab(event:MouseEvent) : void
        {
            this.qdType = tab.selectedIndex + 1;
            this.Qdshow();
            this.checkget();
            return;
        }// end function

        private function setFlag() : void
        {
            if (this._timeID > 0)
            {
                clearTimeout(this._timeID);
                this._timeID = 0;
            }
            this.flag = true;
            return;
        }// end function

        private function showPhonePanel() : void
        {
            var _loc_9:String = null;
            var _loc_10:Array = null;
            var _loc_11:Object = null;
            var _loc_12:Object = null;
            var _loc_1:* = ConfigDictionary.data.box;
            var _loc_2:* = ConfigDictionary.data.item;
            var _loc_3:int = 7;
            var _loc_4:* = _loc_1[_loc_3];
            var _loc_5:* = UserData.getUserData();
            var _loc_6:Array = [];
            var _loc_7:* = (_loc_4.items as String).split(";");
            var _loc_8:int = 0;
            while (_loc_8 < _loc_7.length)
            {
                
                _loc_9 = _loc_7[_loc_8];
                _loc_10 = _loc_9.split("-");
                if (_loc_10.length == 5)
                {
                    if ((_loc_10[3] == 2 || _loc_10[3] == _loc_5.sex) && (_loc_10[4] == _loc_5.career || _loc_10[4] == 0))
                    {
                        _loc_11 = ItemObject.create(_loc_2[_loc_10[0]]);
                        _loc_11.count = _loc_10[1];
                        _loc_6.push(_loc_11);
                    }
                }
                else
                {
                    _loc_12 = ItemObject.create(_loc_2[_loc_10[0]]);
                    _loc_12.count = _loc_10[1];
                    _loc_6.push(_loc_12);
                }
                _loc_8++;
            }
            list2.array = _loc_6;
            list2.renderHandler = new Handler(this.rederHandler);
            btn_sjyz.addEventListener(MouseEvent.CLICK, this.onHuoQu);
            return;
        }// end function

        private function rederHandler(param1:Component, param2:int) : void
        {
            var _loc_3:Object = null;
            var _loc_4:FlashItem = null;
            if (param2 < list2.array.length)
            {
                _loc_3 = list2.array[param2];
                _loc_4 = param1.getChildByName("fi") as FlashItem;
                _loc_4.effshow = true;
                _loc_4.data = _loc_3;
            }
            return;
        }// end function

        private function onHuoQu(event:MouseEvent) : void
        {
            ExternalInterface.call("toMobile");
            return;
        }// end function

        private function showZaiXian() : void
        {
            var _loc_1:int = 0;
            lqgzBtn.addEventListener(MouseEvent.CLICK, this.onLQGZ);
            lqgz1Btn.addEventListener(MouseEvent.CLICK, this.laiDong);
            this.upTime();
            if (this._taskid == 0)
            {
                this._taskid = SecondTimerUtil.instance.addSecondTask(this.upTime);
            }
            if (this.curid < 5)
            {
            }
            else
            {
                if (this.mcArr)
                {
                    _loc_1 = 0;
                    while (_loc_1 < this.mcArr.length)
                    {
                        
                        this.mcArr[_loc_1].dispose();
                        this.mcArr[_loc_1].parent.removeChild(this.mcArr[_loc_1]);
                        this.mcArr[_loc_1] = null;
                        this.mcArr.splice(_loc_1, 1);
                        _loc_1 = _loc_1 - 1;
                        _loc_1++;
                    }
                }
                txt1.text = "已领取";
                txt2.text = "已领取";
                txt3.text = "已领取";
                txt4.text = "已领取";
                var _loc_2:int = 7760738;
                txt3.color = 7760738;
                var _loc_2:* = _loc_2;
                txt2.color = _loc_2;
                var _loc_2:* = _loc_2;
                txt1.color = _loc_2;
                txt4.color = _loc_2;
                liwu_img1.url = "cs2_activity/open.png";
                liwu_img2.url = "cs2_activity/open.png";
                liwu_img3.url = "cs2_activity/open.png";
                liwu_img4.url = "cs2_activity/open.png";
                var _loc_2:Boolean = true;
                liwu_img1.disabled = true;
                var _loc_2:* = _loc_2;
                liwu_img2.disabled = _loc_2;
                var _loc_2:* = _loc_2;
                liwu_img3.disabled = _loc_2;
                liwu_img4.disabled = _loc_2;
                var _loc_2:Boolean = true;
                txt4.disabled = true;
                var _loc_2:* = _loc_2;
                txt3.disabled = _loc_2;
                var _loc_2:* = _loc_2;
                txt2.disabled = _loc_2;
                txt1.disabled = _loc_2;
            }
            if (txt1.text == "可领取" || txt2.text == "可领取" || txt3.text == "可领取" || txt4.text == "可领取")
            {
                if (this.boxMC1 == null && this.boxMC2 == null && this.boxMC3 == null && this.boxMC4 == null && this.isflag)
                {
                    this.isflag = false;
                    App.mloader3.loadSWF(Config.getUrl("assets/images/mainui/baoxian.swf"), 1, new Handler(this.completeFunc1));
                }
                if (zaixianPanel.visible)
                {
                    ModelProxy.change("guideitem", "guideid" + GuideType.GUIDE_ZXJL, lqgz1Btn);
                    GuideView.getInstance().doGuide(GuideType.GUIDE_ZXJL);
                }
                if (ItemUilt.checkUserLevel(70) == 0)
                {
                    this.iskeli();
                }
                this.guideArr[1] = 1;
            }
            else
            {
                this.guideArr[1] = 0;
                this.nokeli();
            }
            return;
        }// end function

        protected function laiDong(event:MouseEvent) : void
        {
            var _loc_2:Array = null;
            var _loc_3:int = 0;
            var _loc_4:Point = null;
            var _loc_5:Array = null;
            var _loc_6:int = 0;
            ModelProxy.change("guide", "hide", GuideType.GUIDE_ZXJL);
            if (GuideView.getInstance().checkIsDo(GuideType.GUIDE_ZXJL) == false && GuideView.getInstance().checkIsDo(GuideType.GUIDE_CLOSEZXJL))
            {
                GuideView.getInstance().doGuide(GuideType.GUIDE_CLOSEZXJL);
            }
            if (txt1.text == "可领取" || txt2.text == "可领取" || txt3.text == "可领取" || txt4.text == "可领取")
            {
                _loc_2 = [];
                _loc_3 = 1;
                while (_loc_3 <= 4)
                {
                    
                    if (this["txt" + _loc_3].text == "可领取")
                    {
                        this.palyMC(_loc_3);
                        _loc_4 = localToGlobal(new Point(this["box" + _loc_3].x + 256, this["box" + _loc_3].y + 80));
                        _loc_5 = this.getBoxArr(this.cfgonline[_loc_3].boxid);
                        _loc_6 = 0;
                        while (_loc_6 < _loc_5.length)
                        {
                            
                            if (_loc_5[_loc_6].icon)
                            {
                                _loc_2.push({icon:_loc_5[_loc_6].icon, x:_loc_4.x, y:_loc_4.y});
                            }
                            _loc_6++;
                        }
                    }
                    _loc_3++;
                }
                PluginManager.instance.sendToServer("online", CMDOnline.GteRewards, null);
                ModelProxy.change("data", "zaixiaopoint", _loc_2);
                LightFactory.clearlight(lqgz1Btn);
            }
            else
            {
                WarningManager.show(73);
                return;
            }
            this.guideArr[1] = 0;
            this.doActiveGuide();
            return;
        }// end function

        protected function palyMC(param1:int) : void
        {
            if (this["boxMC" + param1])
            {
                this["boxMC" + param1].visible = true;
                this["boxMC" + param1].playFromTo(-1, (this["boxMC" + param1].totalFrame - 1), new Handler(this.stopMC, [param1]));
            }
            return;
        }// end function

        private function stopMC(param1:int) : void
        {
            this["boxMC" + param1].stop();
            this["boxMC" + param1].visible = false;
            return;
        }// end function

        private function iskeli() : void
        {
            lqgz1Btn.disabled = false;
            LightFactory.showlight(lqgz1Btn);
            ljzx_img.visible = true;
            return;
        }// end function

        private function nokeli() : void
        {
            lqgz1Btn.disabled = false;
            LightFactory.clearlight(lqgz1Btn);
            ljzx_img.visible = false;
            lqgz1Btn.disabled = true;
            return;
        }// end function

        public function Online(param1:int) : void
        {
            this.curid = param1;
            this.showZaiXian();
            return;
        }// end function

        public function OnlineShow(param1:Object = null) : void
        {
            this.listupdata = UserData.getOnlineData("lastupdate");
            this.curid = UserData.getOnlineData("curid");
            this.intime = UserData.getOnlineData("ontime");
            return;
        }// end function

        private function upTime() : void
        {
            this.servertime = int((ModelProxy.getValue("data", "servertime") + Number(getTimer())) / 1000);
            var _loc_1:* = new Date();
            _loc_1.setTime(this.servertime * 1000);
            var _loc_2:* = _loc_1.getHours() * 3600 + _loc_1.getMinutes() * 60 + _loc_1.getSeconds();
            var _loc_3:* = new Date();
            _loc_3.setTime(this.listupdata);
            if (_loc_1.date > _loc_3.date)
            {
                _loc_1.setHours(0);
                _loc_1.setMinutes(0);
                _loc_1.setSeconds(0);
                this.listupdata = _loc_1.getTime();
                _loc_3.setTime(this.listupdata);
            }
            var _loc_4:* = _loc_3.getHours() * 3600 + _loc_3.getMinutes() * 60 + _loc_3.getSeconds();
            if (this.servertime - int(this.listupdata / 1000) + this.intime >= int(this.cfgonline[1].time) * 60)
            {
                if (this.curid <= 1)
                {
                    txt1.color = 5485622;
                    txt1.text = "可领取";
                    liwu_img1.url = "cs2_activity/close.png";
                    liwu_img1.disabled = false;
                }
                else if (this.curid > 1)
                {
                    txt1.color = 7760738;
                    txt1.text = "已领取";
                    liwu_img1.disabled = true;
                    liwu_img1.url = "cs2_activity/open.png";
                }
            }
            else
            {
                liwu_img1.disabled = false;
                liwu_img1.url = "cs2_activity/close.png";
                txt1.color = 16711680;
                txt1.text = "" + TimeDataFormatUtil.getLeftTime2(_loc_4 + int(this.cfgonline[1].time) * 60 - this.intime - _loc_2);
            }
            if (this.servertime - int(this.listupdata / 1000) + this.intime >= int(this.cfgonline[2].time) * 60)
            {
                if (this.curid <= 2)
                {
                    txt2.color = 5485622;
                    txt2.text = "可领取";
                    liwu_img2.url = "cs2_activity/close.png";
                    liwu_img2.disabled = false;
                }
                else if (this.curid > 2)
                {
                    txt2.color = 7760738;
                    txt2.text = "已领取";
                    liwu_img2.disabled = true;
                    liwu_img2.url = "cs2_activity/open.png";
                }
            }
            else
            {
                liwu_img2.disabled = false;
                liwu_img2.url = "cs2_activity/close.png";
                txt2.text = "" + TimeDataFormatUtil.getLeftTime2(_loc_4 + int(this.cfgonline[2].time) * 60 - this.intime - _loc_2);
                txt2.color = 16711680;
            }
            if (this.servertime - int(this.listupdata / 1000) + this.intime >= int(this.cfgonline[3].time) * 60)
            {
                if (this.curid <= 3)
                {
                    txt3.color = 5485622;
                    txt3.text = "可领取";
                    liwu_img3.disabled = false;
                    liwu_img3.url = "cs2_activity/close.png";
                }
                else if (this.curid > 3)
                {
                    txt3.color = 7760738;
                    txt3.text = "已领取";
                    liwu_img3.disabled = true;
                    liwu_img3.url = "cs2_activity/open.png";
                }
            }
            else
            {
                txt3.color = 16711680;
                liwu_img3.disabled = false;
                liwu_img3.url = "cs2_activity/close.png";
                txt3.text = "" + TimeDataFormatUtil.getLeftTime2(_loc_4 + int(this.cfgonline[3].time) * 60 - this.intime - _loc_2);
            }
            if (this.servertime - int(this.listupdata / 1000) + this.intime >= int(this.cfgonline[4].time) * 60)
            {
                if (this.curid <= 4)
                {
                    txt4.color = 5485622;
                    txt4.text = "可领取";
                    liwu_img4.url = "cs2_activity/close.png";
                    liwu_img4.disabled = false;
                }
                else if (this.curid > 4)
                {
                    txt4.color = 7760738;
                    txt4.text = "已领取";
                    liwu_img4.disabled = true;
                    liwu_img4.url = "cs2_activity/open.png";
                }
            }
            else
            {
                txt4.color = 16711680;
                liwu_img4.url = "cs2_activity/close.png";
                liwu_img4.disabled = false;
                txt4.text = "" + TimeDataFormatUtil.getLeftTime2(_loc_4 + int(this.cfgonline[4].time) * 60 - this.intime - _loc_2);
            }
            onlineText.text = "您今日已在线：" + TimeDataFormatUtil.getLeftTime2(this.servertime - int(this.listupdata / 1000) + this.intime);
            if (txt1.text == "可领取" || txt2.text == "可领取" || txt3.text == "可领取" || txt4.text == "可领取")
            {
                this.iskeli();
            }
            else
            {
                this.nokeli();
            }
            return;
        }// end function

        public function closeHandler() : void
        {
            LightFactory.clearlight(lqBtn3);
            LightFactory.clearlight(qiandaoBtn);
            if (this._taskid > 0)
            {
                SecondTimerUtil.instance.removeTask(this._taskid);
                this._taskid = 0;
            }
            return;
        }// end function

        public function initZaiXian(param1:Object) : void
        {
            var _loc_2:* = param1.day;
            this.servertime = int((ModelProxy.getValue("data", "servertime") + Number(getTimer())) / 1000);
            var _loc_3:* = param1.onlinegz;
            var _loc_4:* = param1.onlinelj;
            if (param1.ollq == 1)
            {
                lqgzBtn.disabled = true;
            }
            else
            {
                lqgzBtn.disabled = false;
                lqgzBtn.mouseEnabled = true;
                if (param1.onlinelj < 1)
                {
                    lqgzBtn.disabled = true;
                }
            }
            benzhouText.text = _loc_4;
            shangzhouText.text = _loc_3;
            this.OnlineShow();
            this.showZaiXian();
            return;
        }// end function

        private function onLQGZ(event:MouseEvent) : void
        {
            lqgzBtn.disabled = true;
            PluginManager.instance.sendToServer("activity", CMDActivity.LingQuGongZi, null);
            return;
        }// end function

        public function getBoxArr(param1:int) : Array
        {
            var _loc_9:String = null;
            var _loc_10:Array = null;
            var _loc_11:Object = null;
            var _loc_2:Array = [];
            var _loc_3:* = ConfigDictionary.data.box;
            var _loc_4:* = ConfigDictionary.data.item;
            var _loc_5:* = _loc_3[param1];
            var _loc_6:* = (_loc_3[param1].items as String).split(";");
            var _loc_7:int = -1;
            var _loc_8:int = 0;
            while (_loc_8 < _loc_6.length)
            {
                
                _loc_9 = _loc_6[_loc_8];
                _loc_10 = _loc_9.split("-");
                if (_loc_10.length >= 5 && _loc_10[4] > 0 && _loc_10[4] != UserData.getUserData("career"))
                {
                }
                else if (_loc_10.length >= 4 && _loc_10[3] != 2 && _loc_10[3] != UserData.getUserData("sex"))
                {
                }
                else
                {
                    _loc_11 = ItemObject.create(_loc_4[_loc_10[0]]);
                    if (_loc_11)
                    {
                        _loc_11.count = _loc_10[1];
                        _loc_11.timeout = _loc_10[5];
                        _loc_2.push(_loc_11);
                    }
                }
                _loc_8++;
            }
            return _loc_2;
        }// end function

        private function showLiQuan() : void
        {
            if (this.textInput && this.textInput.parent)
            {
                this.textInput.parent.removeChild(this.textInput);
                this.textInput = null;
            }
            this.textInput = new TextField();
            this.textInput.width = 338;
            this.textInput.height = 30;
            this.textInput.type = TextFieldType.INPUT;
            this.textInput.defaultTextFormat = new TextFormat("宋体", 14, null, null, null, null, null, null, TextFormatAlign.CENTER);
            this.textInput.x = 80;
            this.textInput.y = 312;
            this.textInput.maxChars = 28;
            this.textInput.textColor = MColor.V_NORMAL2;
            this.textInput.addEventListener(MouseEvent.CLICK, this.onTextInput);
            liquanPanel.addChild(this.textInput);
            liquanPanel.addEventListener(MouseEvent.CLICK, this.onStageClick);
            lqlbBtn.addEventListener(MouseEvent.CLICK, this.onLQLB);
            return;
        }// end function

        private function onTextInput(event:MouseEvent) : void
        {
            GlobalLayer.instance.root.stage.focus = this.textInput;
            event.stopImmediatePropagation();
            return;
        }// end function

        private function onStageClick(event:MouseEvent) : void
        {
            GlobalLayer.instance.root.stage.focus = null;
            return;
        }// end function

        private function onLQLB(event:MouseEvent) : void
        {
            PluginManager.instance.sendToServer("activity", CMDActivity.LingQuLiBao, this.textInput.text);
            return;
        }// end function

        private function showLiXian() : void
        {
            lqBtn1.addEventListener(MouseEvent.CLICK, this.onLQZX1);
            lqBtn2.addEventListener(MouseEvent.CLICK, this.onLQZX2);
            lqBtn3.addEventListener(MouseEvent.CLICK, this.onLQZX3);
            lqBtn1.addEventListener(MouseEvent.ROLL_OVER, this.onOver);
            lqBtn2.addEventListener(MouseEvent.ROLL_OVER, this.onOver);
            lqBtn3.addEventListener(MouseEvent.ROLL_OVER, this.onOver);
            lqBtn1.addEventListener(MouseEvent.ROLL_OUT, this.onUp);
            lqBtn2.addEventListener(MouseEvent.ROLL_OUT, this.onUp);
            lqBtn3.addEventListener(MouseEvent.ROLL_OUT, this.onUp);
            tips1.addEventListener(MouseEvent.ROLL_OVER, this.onOver1);
            tips2.addEventListener(MouseEvent.ROLL_OVER, this.onOver1);
            tips3.addEventListener(MouseEvent.ROLL_OVER, this.onOver1);
            tips1.addEventListener(MouseEvent.ROLL_OUT, this.onUp);
            tips2.addEventListener(MouseEvent.ROLL_OUT, this.onUp);
            tips3.addEventListener(MouseEvent.ROLL_OUT, this.onUp);
            return;
        }// end function

        protected function onOver1(event:MouseEvent) : void
        {
            var _loc_2:* = event.currentTarget as Label;
            var _loc_3:* = _loc_2.globalToLocal(new Point(0, 0));
            ModelProxy.change("tips", "normal", {data:"世界等级经验加成", p:_loc_3});
            return;
        }// end function

        private function onOver(event:MouseEvent) : void
        {
            var _loc_2:* = event.currentTarget as Button;
            var _loc_3:* = _loc_2.globalToLocal(new Point(0, 0));
            var _loc_4:* = int(this.timetxt);
            switch(_loc_2.name)
            {
                case "lqBtn1":
                {
                    ModelProxy.change("tips", "normal", {data:"免费领取" + _loc_4 + "小时经验，共<font color = \'#54b436\'>" + this.getexp() + "</font>经验", p:_loc_3});
                    break;
                }
                case "lqBtn2":
                {
                    ModelProxy.change("tips", "normal", {data:"领取" + _loc_4 + "小时2倍经验，共<font color =\'#54b436\'>" + this.getexp() * 2 + "</font>经验！需要：<font color=\'#54b436\'>" + int(this.getexp() * 2 / 2 / 24000) + "</font>元宝", p:_loc_3});
                    break;
                }
                case "lqBtn3":
                {
                    ModelProxy.change("tips", "normal", {data:"领取" + _loc_4 + "小时5倍经验，共<font color=\'#54b436\'>" + this.getexp() * 5 + "</font>经验！需要：<font color= \'#54b436\'>" + int(this.getexp() * 4 * 5 / 5 / 24000) + "</font>元宝", p:_loc_3});
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        private function onUp(event:MouseEvent) : void
        {
            ModelProxy.change("tips", "state", "close");
            return;
        }// end function

        private function onLQZX1(event:MouseEvent) : void
        {
            this.doBuy(1);
            return;
        }// end function

        private function onLQZX2(event:MouseEvent) : void
        {
            this.doBuy(2);
            return;
        }// end function

        private function onLQZX3(event:MouseEvent) : void
        {
            this.doBuy(4);
            return;
        }// end function

        private function doBuy(param1:int) : void
        {
            this._type = param1;
            var _loc_2:int = 0;
            var _loc_3:int = 0;
            var _loc_4:int = 1;
            var _loc_5:* = UserData.getBagData();
            GuideView.getInstance().hide();
            var _loc_6:* = this.timetxt;
            switch(this._type)
            {
                case 1:
                {
                    if (GuideView.getInstance().checkIsDo(GuideType.GUIDE_CLOSEZX))
                    {
                        GuideView.getInstance().doGuide(GuideType.GUIDE_CLOSEZX);
                    }
                    ModelProxy.change("data", "recycle", 1);
                    PluginManager.instance.sendToServer("activity", CMDActivity.GetLiXianExp, {type:this._type, time:_loc_6});
                    return;
                }
                case 2:
                {
                    _loc_4 = 2;
                    _loc_3 = this.getexp() * _loc_4 / 2 / 24000;
                    break;
                }
                case 4:
                {
                    _loc_4 = 5;
                    _loc_3 = this.getexp() * 4 * _loc_4 / 5 / 24000;
                    break;
                }
                default:
                {
                    break;
                    break;
                }
            }
            if (_loc_3 <= _loc_5.money)
            {
                Alert2.show("你是否确定后以" + _loc_3 + "元宝领取" + this.getexp(_loc_6) * _loc_4 + "经验吗？", "", ["确定", "取消"], this.getExpFunc);
            }
            else
            {
                ModelProxy.change("movetips", "error", "您的元宝不足！");
            }
            this.guideArr[2] = 0;
            this.doActiveGuide();
            return;
        }// end function

        private function getExpFunc(param1:int, param2:Object) : void
        {
            if (param1 == 0)
            {
                if (GuideView.getInstance().checkIsDo(GuideType.GUIDE_CLOSEZX))
                {
                    GuideView.getInstance().doGuide(GuideType.GUIDE_CLOSEZX);
                }
                ModelProxy.change("data", "recycle", 1);
                PluginManager.instance.sendToServer("activity", CMDActivity.GetLiXianExp, {type:this._type, time:this.timetxt});
            }
            return;
        }// end function

        public function itemprice(param1:Object) : void
        {
            var _loc_3:Object = null;
            this.storeitems = [];
            if (this._confitem == null)
            {
                this._confitem = ConfigDictionary.data.item;
            }
            var _loc_2:int = 0;
            while (_loc_2 < this._storeids.length)
            {
                
                _loc_3 = ItemObject.create(this._confitem[param1[_loc_2].itemid]);
                _loc_3.moneyprice = param1[_loc_2].price;
                _loc_3.storeid = this._storeids[_loc_2];
                this.storeitems.push(_loc_3);
                _loc_2++;
            }
            return;
        }// end function

        private function getexp(param1:int = -1) : int
        {
            var _loc_2:int = 0;
            if (param1 == -1)
            {
                param1 = this.leavehour;
            }
            var _loc_3:* = ModelProxy.getValue("data", "user.level");
            if (_loc_3 <= 80)
            {
                _loc_2 = param1 * 600000 * (1 + (_loc_3 - 70) * 5 / 100) * 0.5;
            }
            else if (_loc_3 > 80 && _loc_3 <= 90)
            {
                _loc_2 = param1 * 600000 * (1 + (_loc_3 - 70) * 5 / 100) * 1.2 * 0.5;
            }
            else if (_loc_3 > 90 && _loc_3 <= 100)
            {
                _loc_2 = param1 * 600000 * (1 + (_loc_3 - 70) * 5 / 100) * 1.8 * 0.5;
            }
            else if (_loc_3 > 100)
            {
                _loc_2 = param1 * 600000 * (1 + (_loc_3 - 70) * 5 / 100) * 2.4 * 0.5;
            }
            return _loc_2;
        }// end function

        public function GetLiXian(param1:int) : void
        {
            var _loc_7:int = 0;
            this.leavehour = param1;
            if (this.leavehour <= 0)
            {
                this.leavehour = 0;
                LightFactory.clearlight(lqBtn3);
                lqBtn1.disabled = true;
                lqBtn2.disabled = true;
                lqBtn3.disabled = false;
                lqBtn3.disabled = true;
                this.guideArr[2] = 0;
                ljlx_img.visible = false;
            }
            else
            {
                this.guideArr[2] = 1;
                if (lixianPanel.visible)
                {
                    ModelProxy.change("guideitem", "guideid" + GuideType.GUIDE_LXJL, lqBtn3);
                    GuideView.getInstance().doGuide(GuideType.GUIDE_LXJL);
                }
                LightFactory.showlight(lqBtn3);
                ljlx_img.visible = true;
            }
            var _loc_2:* = UserData.getUserData();
            var _loc_3:* = ConfigDictionary.data.worldlevel;
            var _loc_4:* = ModelProxy.getValue("data", "worldlevel");
            var _loc_5:String = "";
            this.timetxt = this.leavehour;
            if (this.timetxt > 10)
            {
                leijiText.visible = true;
                leijiText.url = "png.common." + int(this.timetxt / 10);
                leijiText1.url = "png.common." + this.timetxt % 10;
            }
            else
            {
                leijiText.visible = false;
                leijiText1.url = "png.common." + this.timetxt;
            }
            var _loc_6:* = this.getexp(this.timetxt);
            if (_loc_3[_loc_4])
            {
                _loc_7 = _loc_2.level;
                if (_loc_4 - 11 >= _loc_7)
                {
                    if (_loc_6 == 0)
                    {
                        _loc_5 = "";
                    }
                    else if (_loc_4 <= _loc_7)
                    {
                        _loc_5 = "";
                    }
                    else if (_loc_4 - _loc_7 <= 10)
                    {
                        _loc_5 = "*" + (100 + (_loc_4 - _loc_7) * _loc_3[_loc_4].expratio / 100) + "%";
                    }
                    else
                    {
                        _loc_5 = "*" + (100 + 10 * _loc_3[_loc_4].expratio / 100) + "%";
                    }
                }
                else
                {
                    _loc_5 = "";
                }
            }
            label_two.text = "" + _loc_6;
            label_three.text = "" + _loc_6 * 2;
            label_five.text = "" + _loc_6 * 5;
            var _loc_8:* = _loc_5;
            tips1.text = _loc_5;
            var _loc_8:* = _loc_8;
            tips2.text = _loc_8;
            tips3.text = _loc_8;
            tips3.x = label_five.x + label_five.width;
            tips2.x = label_three.x + label_three.width;
            tips1.x = label_two.x + label_two.width;
            label_threeyb.text = int(_loc_6 * 2 / 2 / 24000) + "";
            label_fiveyb.text = int(_loc_6 * 4 * 5 / 5 / 24000) + "";
            return;
        }// end function

        private function doActiveGuide() : void
        {
            if (this.guideArr[0] == 1)
            {
                if (qiandaoBtn.visible && this.type == 1)
                {
                    ModelProxy.change("guideitem", "guideid" + GuideType.GUIDE_QD, qiandaoBtn);
                    GuideView.getInstance().doGuide(GuideType.GUIDE_QD);
                }
                else
                {
                    GuideView.getInstance().doGuide(GuideType.GUIDE_QDYQ);
                }
            }
            else if (this.guideArr[1] == 1)
            {
                GuideView.getInstance().doGuide(GuideType.GUIDE_ZXYQ);
            }
            else if (this.guideArr[2] == 1)
            {
                GuideView.getInstance().doGuide(GuideType.GUIDE_LXYQ);
            }
            return;
        }// end function

        public static function set isShow(param1:Boolean) : void
        {
            _isShow = param1;
            return;
        }// end function

        public static function get isShow() : Boolean
        {
            return _isShow;
        }// end function

    }
}
